<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 <title></title>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body onload="startTime()">
<button onclick="addTime()" >add time</button>
 <div id="watch1-show"></div>
 <SCRIPT LANGUAGE="JavaScript">
 <!--
var d = new Date().getTime();

var wlanUsedSeconds = 0;
function clockUpdate() {
	wlanUsedSeconds ++;
	var hour = parseInt(wlanUsedSeconds/3600);
	var min  = parseInt((wlanUsedSeconds%3600)/60);
	var sec  = parseInt(wlanUsedSeconds%60);
	//console.log(hour +" "+min+ " "+sec);
	var h =  ((hour - (-100)) + ':').substring(1);
	h += ((min  - (-100)) + ':').substring(1);
	h += ((sec  - (-100)) + '').substring(1);
	return h;
}
var timeId;

function startTime(){
	document.getElementById("watch1-show").innerHTML =  clockUpdate() ;
	timeId = setTimeout(startTime,1000);
}

function stopTime(){
	window.clearTimeout(timeId);
	wlanUsedSeconds = 0;
}



function addTime(){
	var d2 = new Date().getTime();
	var t = d2 - d;
	console.log(   t  / (86400000*24*3600)   )
}
 //-->
 </SCRIPT>
</body>
</html>